//
//  SFShoucangTableViewCell.m
//  GiftThat
//
//  Created by dllo on 16/1/13.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "SFShoucangTableViewCell.h"

@implementation SFShoucangTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.imageViews = [[UIImageView alloc] init];
        
        self.labels = [[UILabel alloc] init];
        self.labels.textColor = [UIColor whiteColor];
        self.labels.font = [UIFont systemFontOfSize:15];
        
        self.unserimageview = [[UIImageView alloc]init];
        self.unserimageview.image = [UIImage imageNamed:@"under"];
        self.unserimageview.layer.cornerRadius = 10;
        self.unserimageview.clipsToBounds = YES;
        
        [self addSubview:self.imageViews];
        [self addSubview:self.unserimageview];
        [self addSubview:self.labels];
        
        
    }
    
    return self;
    
}

-(void)setSelectionCellModel:(SFSelectionCellModel *)SelectionCellModel{
    if (_SelectionCellModel != SelectionCellModel) {
        _SelectionCellModel = SelectionCellModel;
    }
    
    
    [self.imageViews sd_setImageWithURL:[NSURL URLWithString:_SelectionCellModel.cover_image_url]];


    self.labels.text = _SelectionCellModel.title;
    
  
}

-(void)layoutSubviews {
    [super layoutSubviews];
    
    
    self.imageViews.frame = CGRectMake(5, 5, self.width - 10, self.height - 10);
    self.labels.frame = CGRectMake(10, self.height - 40, self.width, 40);
     self.unserimageview.frame = CGRectMake(5, self.height - 45, self.width - 10, 40);
    
    
    
}













- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
